/**
 * Created by lvlq on 16/3/12.
 */
module.exports.getToday = function () {
    var date = new Date();
    var str = date.getFullYear() +
        "-" + pad((date.getMonth() + 1), 2) +
        "-" + pad((date.getDate()), 2) +
        " 00:00:00";
    console.log(str);
    var d = new Date(str);
    return d.getTime() / 1000;
};

var pad = function (num, n) {
    var len = num.toString().length;
    while (len < n) {
        num = "0" + num;
        len++;
    }
    return num;
};